package demo;

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import okio.BufferedSource;
import okio.Okio;
import okio.Source;

public class SourceDemo1 {

	public static void main(String[] args) throws IOException {
		Source source = null;
		BufferedSource bSource = null;
		File file = new File("E:\\zsl\\okio1.txt");
		// 读文件
		source = Okio.source(file);
		// 通过source拿到 bufferedSource
		bSource = Okio.buffer(source);
		String read = bSource.readString(Charset.forName("utf-8"));
		System.out.println(read);
	}

}
